<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui">
<h:head>
	<link href="../../css/component.css" rel="stylesheet" type="text/css" />
</h:head>

<ui:param name="bean" value="#{serverConfigAction}" />
<h:body>
	<h:form id="fsearch">
		<p:growl id="growl" showDetail="true" sticky="true" />
		
		<p:panel id="panel" header="查询添加" style="margin-bottom:10px;">
			<p:dataTable id="dlist0" var="l" value="#{bean.entity}" resizableColumns="true" paginator="false" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="15,30" rows="30" style="text-align:center;">
				<p:column headerText="区服ID" styleClass="column" style="width:170px">
					<h:inputText value="#{l.id}" />
				</p:column>
				<p:column headerText="区服名称" styleClass="column" style="width:170px">
					<h:inputText value="#{l.name}" />
				</p:column>
				<p:column headerText="区服渠道" styleClass="column" style="width:170px">
					<p:selectCheckboxMenu value="#{bean.selected.get(0).sels}" label="请选择" filter="true" filterMatchMode="startsWith" panelStyle="width:250px">
			            <f:selectItems value="#{bean.allItmes}" />
			        </p:selectCheckboxMenu>
				</p:column>
                <p:column headerText="区服分组" styleClass="column" style="width:170px">
                    <p:selectOneMenu value="#{l.serverType}">
                        <f:selectItem itemLabel="混服" itemValue="hf" />
                        <f:selectItem itemLabel="ios正版" itemValue="ioszb" />
                        <f:selectItem itemLabel="应用宝" itemValue="yyb" />
                        <f:selectItem itemLabel="硬核联盟" itemValue="yhlm" />
                    </p:selectOneMenu>
                </p:column>
				<p:column headerText="区服容量上限" styleClass="column" style="width:170px">
					<h:inputText value="#{l.capacity}" />
				</p:column>
				<p:column headerText="渠道描述" styleClass="column" style="width:170px">
					<h:inputText value="#{l.description}" />
				</p:column>
				<p:column headerText="是否可用" styleClass="column" style="width:170px">
					<p:selectBooleanCheckbox value="#{l.used}" />
				</p:column>
				<p:column headerText="操作" styleClass="column" style="width:130px">
					<p:commandButton value="查询" action="#{bean.search()}" update=":data" ajax="false" />
					<p:commandButton value="添加" action="#{bean.add()}" update=":data" ajax="false" />
				</p:column>
			</p:dataTable>
   		</p:panel>
	</h:form>
	<br />

	<h:form id="dform">
		<div class="data" id="data">
			<p:panel id="panel1" header="结果展示" style="margin-bottom:10px;">
				<p:dataTable id="dlist" rowIndexVar="index" var="l" value="#{bean.list}" resizableColumns="true" paginator="true" paginatorPosition="top" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="15,30" rows="30" style="text-align:center;">
					<p:column headerText="区服ID" styleClass="column" style="width:170px">
						<h:outputLabel value="#{l.id}" />
					</p:column>
					<p:column headerText="区服名称" styleClass="column" style="width:170px">
						<h:inputText value="#{l.name}" />
					</p:column>
					<p:column headerText="区服渠道" styleClass="column" style="width:170px">
						<p:selectCheckboxMenu value="#{bean.selected.get(index+1).sels}" label="请选择" filter="true" filterMatchMode="startsWith" panelStyle="width:250px">
				            <f:selectItems value="#{bean.allItmes}" />
				        </p:selectCheckboxMenu>
					</p:column>
                    <p:column headerText="区服分组" styleClass="column" style="width:170px">
                        <p:selectOneMenu value="#{l.serverType}">
                            <f:selectItem itemLabel="混服" itemValue="hf" />
                            <f:selectItem itemLabel="ios正版" itemValue="ioszb" />
                            <f:selectItem itemLabel="应用宝" itemValue="yyb" />
                            <f:selectItem itemLabel="硬核联盟" itemValue="yhlm" />
                        </p:selectOneMenu>
                    </p:column>
					<p:column headerText="区服容量上限" styleClass="column" style="width:170px">
						<h:inputText value="#{l.capacity}" />
					</p:column>
					<p:column headerText="渠道描述" styleClass="column" style="width:170px">
						<h:inputText value="#{l.description}" />
					</p:column>
					<p:column headerText="是否可用" styleClass="column" style="width:170px">
						<p:selectBooleanCheckbox value="#{l.used}" />
					</p:column>
					<p:column headerText="操作" styleClass="column" style="width:130px">
						<p:commandButton value="修改" action="#{bean.modify(l, index + 1)}" update=":data" ajax="false" />
						<p:commandButton value="删除" action="#{bean.delete(l.id)}" update=":data" ajax="false" />
					</p:column>
				</p:dataTable>
	   		</p:panel>
   		</div>
	</h:form>
	
	
</h:body>
</html>
